import MyContext from './context.js'
import reducer from './reducer.js'
import { useReducer } from 'react'

function MyProvider(props) {
  const [state, dispatch] = useReducer(reducer, {
    count: 0, list: ["aaa", "bb", "ccc"], info: {}
  })

  return (
    <MyContext.Provider value={{ state, dispatch }}>
      {props.children}
    </MyContext.Provider>
  )
}

export default MyProvider